package com.example.customviewtest.wymusic;

import android.content.Context;
import android.util.Log;
import android.view.View;
import android.widget.ImageView;

import androidx.recyclerview.widget.RecyclerView;

import com.bumptech.glide.Glide;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.example.customviewtest.R;

import java.util.List;

class WYListAdapter extends BaseQuickAdapter<MusicBean.HotBean, BaseViewHolder> {
    private Context context;

    public WYListAdapter(Context context, int layout, List<MusicBean.HotBean> hot) {
        super(layout, hot);
        this.context = context;
    }

    @Override
    protected void convert(BaseViewHolder helper, MusicBean.HotBean item) {
        Log.i("xd----", item.getPath());
        ImageView img = helper.getView(R.id.list_item_img);
        Glide.with(context).load(item.getPoster()).into(img);
        helper.setText(R.id.list_item_name_tv, item.getName());
        helper.setText(R.id.list_item_author_tv, item.getAuthor());

    }
}
